/*
 * SpriteBase.cpp
 *
 *  Created on: 3 avr. 2009
 *      Author: CHETIER
 */

#include "SpriteBase.h"

int SpriteBase::draw(SDL_Surface *pSreen)
{
	if(_srf_sprite != NULL)
	{
		SDL_Rect *spriteRect = new SDL_Rect();
		spriteRect->x = _x;
		spriteRect->y = _y;
		spriteRect->h = getHeight();
		spriteRect->w = getWidth();
		SDL_BlitSurface(_srf_sprite, NULL, pSreen, spriteRect);

		if(spriteRect != NULL) delete spriteRect, spriteRect = NULL;
	}
	else
	{
		return EXIT_FAILURE;
	}
	return EXIT_SUCCESS;
}
